/*
 *	Copyright © 2013 Changsha Shishuo Network Technology Co., Ltd. All rights reserved.
 *	长沙市师说网络科技有限公司 版权所有
 *	http://www.shishuo.com
 */

package com.hlingsoft.cms.dao;

import com.hlingsoft.cms.entity.Likes;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户服务
 *
 * @author Zhang jiale
 *
 */

@Repository
public interface LikesDao {


	/**
	 * 点赞
	 *
	 * @param likes
	 * @return Integer
	 */
	public long addLikes(Likes likes);

	/**
	 * 根据commentId查找
	 * @param myId
	 * @param commentId
	 * @return
	 */
	public Likes getLikesByCommentId(@Param("myId") long myId,@Param("commentId") long commentId);


	/**
	 * 判断我是否赞过newsId
	 * @param myId
	 * @param newsId
	 * @return
	 */
	public Likes getLikesByNewsId(@Param("myId") long myId,@Param("newsId") long newsId);



	/**
	 * 查找所有的点赞
	 * @param newsId
	 * @return
	 */
	public List<Likes> getLikesByNewsId2(@Param("newsId") long newsId);


	/**
	 * 查找我赞过的动态
	 * @param myId
	 * @return
	 */
	public List<Likes> getLikesByMyId(@Param("myId") long myId);


	/**
	 * 被点赞次数
	 * @param toId
	 * @return
	 */
	public int getLikesByAppUserIdCount(@Param("toId") long toId);


	/**
	 * 删除点赞
	 * @param id
	 * @return
	 */
	public int deleteLikes(@Param("id") long id);

	/**
	 * 查找赞我的人
	 * @param toId
	 * @return
	 */
	public List<Likes> getLikesByToId(@Param("toId") long toId);


	public List<Likes> getLikesByAppUserIdWithNone(@Param("appUserId") long appUserId);


	public int updateLikes(Likes likes);


}
